package Month07.day28;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;

public class test6 {
    public static void main(String[] args) {
        ArrayList<String> worldList = new ArrayList<>();
        worldList.add("《教父》");
        worldList.add("《肖申克的救赎》");
        worldList.add("《辛德勒的名单》");
        worldList.add("《公民凯恩》");
        worldList.add("《卡萨布兰卡》");
        worldList.add("《教父续集》");
        worldList.add("《七武士》");
        worldList.add("《星球大战》");
        worldList.add("《美国美人》");
        worldList.add("《飞跃疯人院》");
        ArrayList<String> chinaList = new ArrayList<>();
        chinaList.add("《霸王别姬》");
        chinaList.add("《大闹天宫》");
        chinaList.add("《鬼子来了》");
        chinaList.add("《大话西游》");
        chinaList.add("《活着》");
        chinaList.add("《饮食男女》");
        chinaList.add("《无间道》");
        chinaList.add("《天书奇谈》");
        chinaList.add("《哪吒闹海》");
        chinaList.add("《春光乍泄》");
        List<String> collect = worldList.stream().limit(3).collect(Collectors.toList());
        List<String> collect1 = chinaList.stream().skip(5).collect(Collectors.toList());
        System.out.println(collect);
        System.out.println(collect1);
        Stream<String> limit = worldList.stream().limit(5);
        Stream<String> limit1 = chinaList.stream().limit(5);
        List<String> collect2 = Stream.concat(limit, limit1).collect(Collectors.toList());
        System.out.println(collect2);
    }
}
